#ifndef LOG_H
#define LOG_H

#include "types.h"

#ifdef ERR
# undef ERR /* useful with ncurses.h */
#endif

typedef enum
{
    NONE = -1,
    ERR, /* error (something not expected/not implemented and important) */
    WRN, /* warning (something not expected/not implemented but not fatal) */
    INF, /* info (for important things happening, but which are not problems) */
    DBG, /* debug (just info for ELF or HLE in example) */
    TRC, /* trace (mostly for graphics info) */
    FUL, /* full (totally full: all the relocations & executed instructions) */
    NUMDBGLVL
} DbgLvl;

typedef enum
{
    CORE,
    CPU,
    ELF,
    FS,
    GFX,
    HARDWARE,
    HLE,
    LOADER,
    MEMMAP,
    THREAD,
    VFPU,
    AUDIO
} DbgType;

void logInitTh();
void logFreeTh();
void _log(DbgLvl lvl, DbgType type, const char *fmt, ...);

extern DbgLvl debug_level;
extern char *dbgTypeName[];
extern char *dbgLvlName[];

#endif
